/*
 * @Description:
 * @Autor: lizhengkun
 * @Date: 2021-08-10 11:01:24
 */
// proxy 代理  转发规则
const proxy = require('http-proxy-middleware');

module.exports = function (app) {
  app.use(
    proxy(['/stock', '/stock-sit', '/api', '/template'], {
      // target: "http://stock.hn3.mofasuidao.cn",
      target: 'https://officeviptest.mbcloud.com:6443',
      changeOrigin: true,
      pathRewrite: {
        // "^/stock/api": "", // 连后台本地服务，重写请求，比如我们源访问的是api/old-path，那么请求会被解析为/api/new-path
        // "^/stock-sit/api": "", // 同上
      },
      logLevel: 'silent',
    })
  );
};
